/**
 * @author - cozevn.
 * @Date : 01-Dec-2011
 */
package vn.com.tiz.DocumentZ;

import java.util.ArrayList;

import vn.com.tiz.DocumentZ.data.PageEntry;
import vn.com.tiz.DocumentZ.view.PageView;
import vn.com.tiz.DocumentZ.view.VideoViewer;
import vn.com.tiz.DocumentZ.view.WipeView;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.VideoView;
import android.widget.FrameLayout.LayoutParams;

public class actDocmentViewer extends Activity {

	WipeView mainView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		getWindow().requestFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.document_viewer);
		
		MapLayout();
		loadPages();
		
		mainView.setBackgroundColor(Color.GRAY);
	}
	
	private void loadPages(){
		
		
		int pageCount = 5;
		ArrayList<PageEntry> listPage = new ArrayList<PageEntry>();		
		for(int i=0;i<pageCount;i++){
			PageEntry petry = new PageEntry();
			//petry.MainBG = 
		}
		
		
//		FrameLayout f = new FrameLayout(this);
//		f.setBackgroundResource(R.drawable.begin);
//		
//		mainView.addView(f);
//		
//		FrameLayout f1 = new FrameLayout(this);
//		f1.setBackgroundResource(R.drawable.page1);
//		
//		mainView.addView(f1);
//		
//		FrameLayout f2 = new FrameLayout(this);
//		f2.setBackgroundResource(R.drawable.page2);		
//		mainView.addView(f2);
//		
//		FrameLayout f3 = new FrameLayout(this);
//		f3.setBackgroundResource(R.drawable.page3);		
//		mainView.addView(f3);
//		
//		FrameLayout f4 = new FrameLayout(this);
//		f4.setBackgroundResource(R.drawable.page4);		
//		mainView.addView(f4);
		
		PageView page = new PageView(this);
		page.setImage(R.drawable.page0);
		
		//VideoView video = new VideoView(this);
		VideoViewer video = new VideoViewer(this);
		LayoutParams lparam = new LayoutParams(200,200);
		video.setLayoutParams(lparam);
		//video.setVideoPath("/mnt/sdcard/");
		
		//TextView txv = new TextView(this);
		//txv.setText("aaaa");
		//page.addItem(video);
		
		mainView.addView(page);
		
		PageView page1 = new PageView(this);
		page1.setImage(R.drawable.page6);
		mainView.addView(page1);
	}
	
	private void MapLayout(){
		mainView = (WipeView)findViewById(R.id.docView);
	}	
}
